import Vue from 'vue'
import Router from 'vue-router'
import tabs from 'assets/tabs'

Vue.use(Router)

const routes = [
  {
    path: '/',
    component: () => import('@/index'),
    children: []
  }
]
tabs.forEach(tab => routes[0].children.push({ path: tab.path, component: () => import('@/tabs/' + tab.path)}))

routes.push({ path: '*', component: () => import('@/404') })
routes[0].redirect = routes[0].children[0]

export default new Router({
  routes
})
